<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-flash.min.css">
  <script src="/lib/pace/pace.min.js"></script>


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://kechenhh.gitee.io').hostname,
    root: '/',
    scheme: 'Gemini',
    version: '7.7.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="模块的使用方法看 https:&#x2F;&#x2F;python-wordpress-xmlrpc.readthedocs.io&#x2F;en&#x2F;latest&#x2F;  安装：带有自定义栏目字段的发布文章代码1234567891011121314151617181920212223242526272829303132333435#coding:utf-8from wordpress_xmlrpc import Client, W">
<meta property="og:type" content="article">
<meta property="og:title" content="python使用xmlrpc自动发布文章到wordpress">
<meta property="og:url" content="https://kechenhh.gitee.io/python%E4%BD%BF%E7%94%A8xmlrpc%E8%87%AA%E5%8A%A8%E5%8F%91%E5%B8%83%E6%96%87%E7%AB%A0%E5%88%B0wordpress.html">
<meta property="og:site_name" content="我的博客">
<meta property="og:description" content="模块的使用方法看 https:&#x2F;&#x2F;python-wordpress-xmlrpc.readthedocs.io&#x2F;en&#x2F;latest&#x2F;  安装：带有自定义栏目字段的发布文章代码1234567891011121314151617181920212223242526272829303132333435#coding:utf-8from wordpress_xmlrpc import Client, W">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-01-17T08:27:42.000Z">
<meta property="article:modified_time" content="2020-12-14T09:47:00.266Z">
<meta property="article:author" content="kechenhh">
<meta property="article:tag" content="Python">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://kechenhh.gitee.io/python%E4%BD%BF%E7%94%A8xmlrpc%E8%87%AA%E5%8A%A8%E5%8F%91%E5%B8%83%E6%96%87%E7%AB%A0%E5%88%B0wordpress.html">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>python使用xmlrpc自动发布文章到wordpress | 我的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">我的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle"> my blog</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://kechenhh.gitee.io/python%E4%BD%BF%E7%94%A8xmlrpc%E8%87%AA%E5%8A%A8%E5%8F%91%E5%B8%83%E6%96%87%E7%AB%A0%E5%88%B0wordpress.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="kechenhh">
      <meta itemprop="description" content="学习笔记">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="我的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          python使用xmlrpc自动发布文章到wordpress
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-01-17 16:27:42" itemprop="dateCreated datePublished" datetime="2020-01-17T16:27:42+08:00">2020-01-17</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-12-14 17:47:00" itemprop="dateModified" datetime="2020-12-14T17:47:00+08:00">2020-12-14</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Python/" itemprop="url" rel="index">
                    <span itemprop="name">Python</span>
                  </a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <blockquote>
<p>模块的使用方法看 <a href="https://python-wordpress-xmlrpc.readthedocs.io/en/latest/" target="_blank" rel="noopener">https://python-wordpress-xmlrpc.readthedocs.io/en/latest/</a></p>
</blockquote>
<h3 id="安装："><a href="#安装：" class="headerlink" title="安装："></a>安装：</h3><h3 id="带有自定义栏目字段的发布文章代码"><a href="#带有自定义栏目字段的发布文章代码" class="headerlink" title="带有自定义栏目字段的发布文章代码"></a>带有自定义栏目字段的发布文章代码</h3><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#coding:utf-8</span></span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc <span class="keyword">import</span> Client, WordPressPost</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods.posts <span class="keyword">import</span> GetPosts, NewPost</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods.users <span class="keyword">import</span> GetUserInfo</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> posts</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> taxonomies</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc <span class="keyword">import</span> WordPressTerm</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.compat <span class="keyword">import</span> xmlrpc_client</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> media, posts</span><br><span class="line"><span class="keyword">import</span> sys</span><br><span class="line">reload(sys)</span><br><span class="line">sys.setdefaultencoding(<span class="string">'utf-8'</span>)</span><br><span class="line"></span><br><span class="line">wp = Client(<span class="string">'http://您的域名/xmlrpc.php'</span>, <span class="string">'后台账号'</span>, <span class="string">'后台密码'</span>)</span><br><span class="line"></span><br><span class="line">post = WordPressPost()</span><br><span class="line">post.title = <span class="string">'文章标题'</span></span><br><span class="line">post.content = <span class="string">'文章内容'</span></span><br><span class="line">post.post_status = <span class="string">'publish'</span> <span class="comment">#文章状态，不写默认是草稿，private表示私密的，draft表示草稿，publish表示发布</span></span><br><span class="line"></span><br><span class="line">post.terms_names = &#123;</span><br><span class="line">    <span class="string">'post_tag'</span>: [<span class="string">'test'</span>, <span class="string">'firstpost'</span>], <span class="comment">#文章所属标签，没有则自动创建</span></span><br><span class="line">    <span class="string">'category'</span>: [<span class="string">'Introductions'</span>, <span class="string">'Tests'</span>] <span class="comment">#文章所属分类，没有则自动创建</span></span><br><span class="line"> &#125;</span><br><span class="line"></span><br><span class="line">post.custom_fields = []   <span class="comment">#自定义字段列表</span></span><br><span class="line">post.custom_fields.append(&#123;  <span class="comment">#添加一个自定义字段</span></span><br><span class="line">        <span class="string">'key'</span>: <span class="string">'price'</span>,</span><br><span class="line">        <span class="string">'value'</span>: <span class="number">3</span></span><br><span class="line">&#125;)</span><br><span class="line">post.custom_fields.append(&#123; <span class="comment">#添加第二个自定义字段</span></span><br><span class="line">        <span class="string">'key'</span>: <span class="string">'ok'</span>,</span><br><span class="line">        <span class="string">'value'</span>: <span class="string">'天涯海角'</span></span><br><span class="line">&#125;)</span><br><span class="line">post.id = wp.call(posts.NewPost(post))&lt;/pre&gt;</span><br></pre></td></tr></table></figure>

<a id="more"></a>

<h3 id="带有特色图像缩略图的发布文章"><a href="#带有特色图像缩略图的发布文章" class="headerlink" title="带有特色图像缩略图的发布文章"></a>带有特色图像缩略图的发布文章</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#coding:utf-8</span></span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc <span class="keyword">import</span> Client, WordPressPost</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods.posts <span class="keyword">import</span> GetPosts, NewPost</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods.users <span class="keyword">import</span> GetUserInfo</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> posts</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> taxonomies</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc <span class="keyword">import</span> WordPressTerm</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.compat <span class="keyword">import</span> xmlrpc_client</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> media, posts</span><br><span class="line"><span class="keyword">import</span> sys</span><br><span class="line">reload(sys)</span><br><span class="line">sys.setdefaultencoding(<span class="string">'utf-8'</span>)</span><br><span class="line"></span><br><span class="line">wp = Client(<span class="string">'http://您的域名/xmlrpc.php'</span>, <span class="string">'后台账号'</span>, <span class="string">'后台密码'</span>)</span><br><span class="line"></span><br><span class="line">filename = <span class="string">'./my.jpg'</span> <span class="comment">#上传的图片文件路径</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># prepare metadata</span></span><br><span class="line">data = &#123;</span><br><span class="line">        <span class="string">'name'</span>: <span class="string">'picture.jpg'</span>,</span><br><span class="line">        <span class="string">'type'</span>: <span class="string">'image/jpeg'</span>,  <span class="comment"># mimetype</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment"># read the binary file and let the XMLRPC library encode it into base64</span></span><br><span class="line"><span class="keyword">with</span> open(filename, <span class="string">'rb'</span>) <span class="keyword">as</span> img:</span><br><span class="line">        data[<span class="string">'bits'</span>] = xmlrpc_client.Binary(img.read())</span><br><span class="line"></span><br><span class="line">response = wp.call(media.UploadFile(data))</span><br><span class="line"><span class="comment"># response == &#123;</span></span><br><span class="line"><span class="comment">#       'id': 6,</span></span><br><span class="line"><span class="comment">#       'file': 'picture.jpg'</span></span><br><span class="line"><span class="comment">#       'url': 'http://www.example.com/wp-content/uploads/2012/04/16/picture.jpg',</span></span><br><span class="line"><span class="comment">#       'type': 'image/jpeg',</span></span><br><span class="line"><span class="comment"># &#125;</span></span><br><span class="line">attachment_id = response[<span class="string">'id'</span>]</span><br><span class="line"></span><br><span class="line">post = WordPressPost()</span><br><span class="line">post.title = <span class="string">'文章标题'</span></span><br><span class="line">post.content = <span class="string">'文章正文'</span></span><br><span class="line">post.post_status = <span class="string">'publish'</span>  <span class="comment">#文章状态，不写默认是草稿，private表示私密的，draft表示草稿，publish表示发布</span></span><br><span class="line">post.terms_names = &#123;</span><br><span class="line">    <span class="string">'post_tag'</span>: [<span class="string">'test'</span>, <span class="string">'firstpost'</span>], <span class="comment">#文章所属标签，没有则自动创建</span></span><br><span class="line">    <span class="string">'category'</span>: [<span class="string">'Introductions'</span>, <span class="string">'Tests'</span>] <span class="comment">#文章所属分类，没有则自动创建</span></span><br><span class="line"> &#125;</span><br><span class="line">post.thumbnail = attachment_id <span class="comment">#缩略图的id</span></span><br><span class="line">post.id = wp.call(posts.NewPost(post))</span><br></pre></td></tr></table></figure>

<h3 id="单独创建新的分类和标签"><a href="#单独创建新的分类和标签" class="headerlink" title="单独创建新的分类和标签"></a>单独创建新的分类和标签</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#coding:utf-8</span></span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc <span class="keyword">import</span> Client, WordPressPost</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc <span class="keyword">import</span> WordPressTerm</span><br><span class="line"><span class="keyword">from</span> wordpress_xmlrpc.methods <span class="keyword">import</span> taxonomies</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> sys</span><br><span class="line">reload(sys)</span><br><span class="line">sys.setdefaultencoding(<span class="string">'utf-8'</span>)</span><br><span class="line"></span><br><span class="line">wp = Client(<span class="string">'http://您的域名/xmlrpc.php'</span>, <span class="string">'后台账号'</span>, <span class="string">'后台密码'</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">#新建标签</span></span><br><span class="line">tag = WordPressTerm()</span><br><span class="line">tag.taxonomy = <span class="string">'post_tag'</span></span><br><span class="line">tag.name = <span class="string">'My New Tag12'</span><span class="comment">#标签名称</span></span><br><span class="line">tag.slug = <span class="string">'bieming12'</span><span class="comment">#标签别名，可以忽略</span></span><br><span class="line">tag.id = wp.call(taxonomies.NewTerm(tag))<span class="comment">#返回的id</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#新建分类</span></span><br><span class="line">cat = WordPressTerm()</span><br><span class="line">cat.taxonomy = <span class="string">'category'</span></span><br><span class="line">cat.name = <span class="string">'cat1'</span><span class="comment">#分类名称</span></span><br><span class="line">cat.slug = <span class="string">'bieming2'</span><span class="comment">#分类别名，可以忽略</span></span><br><span class="line">cat.id = wp.call(taxonomies.NewTerm(cat))<span class="comment">#新建分类返回的id</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#新建子分类</span></span><br><span class="line">parent_cat = client.call(taxonomies.GetTerm(<span class="string">'category'</span>, <span class="number">20</span>))<span class="comment">#20是父分类的id</span></span><br><span class="line"></span><br><span class="line">child_cat = WordPressTerm()</span><br><span class="line">child_cat.taxonomy = <span class="string">'category'</span></span><br><span class="line">child_cat.parent = parent_cat.id</span><br><span class="line">child_cat.name = <span class="string">'My Child Category'</span><span class="comment">#分类名称</span></span><br><span class="line">child_cat.slug = <span class="string">'beidongdui'</span><span class="comment">#分类别名，可以忽略</span></span><br><span class="line">child_cat.id = wp.call(taxonomies.NewTerm(child_cat))<span class="comment">#新建分类返回的id</span></span><br></pre></td></tr></table></figure>


    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Python/" rel="tag"># Python</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/Python%E6%89%93%E5%8C%85%E6%88%90exe.html" rel="prev" title="Python打包成exe">
      <i class="fa fa-chevron-left"></i> Python打包成exe
    </a></div>
      <div class="post-nav-item">
    <a href="/python%E7%88%AC%E8%99%AB%E7%BD%91%E9%A1%B5%E8%A7%A3%E6%9E%90%E4%B9%8Bparsel%E6%A8%A1%E5%9D%97.html" rel="next" title="python爬虫网页解析之parsel模块">
      python爬虫网页解析之parsel模块 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#安装："><span class="nav-number">1.</span> <span class="nav-text">安装：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#带有自定义栏目字段的发布文章代码"><span class="nav-number">2.</span> <span class="nav-text">带有自定义栏目字段的发布文章代码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#带有特色图像缩略图的发布文章"><span class="nav-number">3.</span> <span class="nav-text">带有特色图像缩略图的发布文章</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#单独创建新的分类和标签"><span class="nav-number">4.</span> <span class="nav-text">单独创建新的分类和标签</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="kechenhh"
      src="/images/avatar.gif">
  <p class="site-author-name" itemprop="name">kechenhh</p>
  <div class="site-description" itemprop="description">学习笔记</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">19</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">10</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/kechenhh" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;kechenhh" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">kechenhh</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.1
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.7.0
  </div>

        








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

</body>
</html>
